
class Solution:
    def mergeSortedArray(self,A,B):
        i,j = 0,0
        c = []
        while i <len(A) and j < len(B):
            if A[i] < B[j]:
                c.append(A[i])
                i += 1
            else:
                c.append(B[j])
                j +=1
        while i <len(A):
            c.append(A[i])
            i +=1
        while j <len(B):
            c.append(B[j])
            j +=1
        return c

if __name__ == '__main__':
    A = [1,3,4]
    B = [2,3,5]
    solution = Solution()
    print(solution.mergeSortedArray(A,B))